// uses the GM-compiler's built-in function, with a redefined root
var dfault = false; // this means if a pref does not exist, it's the same as disabled -- SO BUILD PREFS!
// three-bangs = negated flag (it's a negative function name for a positive preference)
var checker = GM_getValue(prefName+'active', dfault);
return !!!checker;
}
// return Name, or mask that we use as a preference, if server is known by an alias
function getMask(prefName) {
var mask = prefName;
// all the various servers that operate for linkbucks
var linkbucksreg = /linkbucks|baberepublic|blahetc|linkgalleries|linkseer|picturesetc|placepictures|qvvo|realfiles|seriousfiles|seriousurls|thatsprime|thesefiles|thesegalleries|thosegalleries|tinybucks|uberpicz|ubervidz|ubucks|ugalleries|urlpulse|viraldatabase|youfap|zxxo/i;
if (linkbucksreg.exec(prefName)) {
mask = "linkbucks";
} else if (prefName == '4shared') {
mask = 'fourshared';
} else if (prefName.match('mega(upload|porn)')) {
mask = 'megaupload';
}
return mask;
}
// wrapper function, for future expansion
function logIt(message) {
GM_log(message);
}
function pathSplit(path) {
return path.split('/');
}
function stripLocation(url) {
// ditch the protocol (eg, "http://" "https://" "gopher://")
// and the path (eg "http://sub.domain.tld/this/is/the/path.mp3")
// leaving only "sub.domain.tld" (in this case)
// equiv. to location.hostname BUT we use this on arbitrary paths (eg, sharebee)
var idx = url.indexOf("://")+3;
var Domain = url.substring(idx);
idx = Domain.indexOf("/");
Domain = Domain.substring(0, idx);
return Domain;
}
// given a valid URL, return the hostname as an array